﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WSManager.Model;
using FluentValidation;


namespace WSManager.ModelValidation
{
    public class WebImageValidator: AbstractValidator<WebImage>
    {
        public WebImageValidator()
        {
            RuleFor(i => i.Id).NotEmpty();
            RuleFor(i => i.ImageData).NotNull().When(i => string.IsNullOrWhiteSpace(i.Path));
            RuleFor(i => i.Path).NotEmpty().When(i => i.ImageData == null);
        }
    }
}
